<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Arr;

class Finance extends Model
{
    protected $table = 'finance';
    protected $guarded = ['id'];

    protected $appends = ['pay_type_name'];

    public function getPayTypeNameAttribute()
    {
        return Arr::get(config('freeswitch.pay_type'),$this->pay_type,null);
    }

    public function customer()
    {
        return $this->hasOne(Customer::class,'id','customer_id');
    }

}
